package cn.sxt.oop;

import java.util.Arrays;

/**
 * 创建二维数组
 */
public class TowArrays {
    public static void main(String[] args){
        int[][] a = new int[3][];
        a[0] = new int[4];
        a[1] = new int[2];
        a[2] = new int[3];

        a = new int[][]{
                {1,2,3,4},
                {0,1},
                {1,2,3}
        };
        System.out.println(a[2][2]);

        //二维数组存储表格数据
        Object[] emp1 = {1001,"高琪",18,"讲师","2020.06.06"};
        Object[] emp2 = {1002,"高2琪",18,"讲师","2020.06.06"};
        Object[] emp3 = {1003,"高3琪",18,"讲师","2020.06.06"};

        Object[][] tableData = new Object[3][];
        tableData[0] = emp1;
        tableData[1] = emp2;
        tableData[2] = emp3;

        for (Object[] temp: tableData) {
            System.out.println(Arrays.toString(temp));
        }
    }
}
